/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.chl.da.pagebeans;

import edu.chl.da.ejb.core.Airplane;
import edu.chl.da.ejb.core.Seat;
import edu.chl.da.ejb.ctrl.IManageAirplane;
import edu.chl.da.ejb.ctrl.IManageSeat;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Max
 */
@ManagedBean(name = "ManageAirplaneModel")
@RequestScoped
public class ManageAirplaneModel {

    @EJB
    IManageAirplane ima;

    @EJB
    IManageSeat ims;

    public ManageAirplaneModel() {

    }

    public List<Airplane> listAllAirplanes(){
        return ima.getAllAirplanes();
    }

    public List<Seat> getSeats(Airplane airplane){
        return ims.getSeatList(airplane);
    }
}
